/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "col_sancion")
//@NamedQueries({@NamedQuery(name = "Sancion.findAll", query = "SELECT s FROM Sancion s"),
//@NamedQuery(name = "Sancion.findBySanCodigo", query = "SELECT s FROM Sancion s WHERE s.sanCodigo = :sanCodigo"),
//@NamedQuery(name = "Sancion.findBySanNombre", query = "SELECT s FROM Sancion s WHERE s.sanNombre = :sanNombre"),
//@NamedQuery(name = "Sancion.findBySanDescripcion", query = "SELECT s FROM Sancion s WHERE s.sanDescripcion = :sanDescripcion"),
//@NamedQuery(name = "Sancion.findBySanPenalidad", query = "SELECT s FROM Sancion s WHERE s.sanPenalidad = :sanPenalidad"),
////@NamedQuery(name = "Sancion.findBySanDocumento", query = "SELECT s FROM Sancion s WHERE s.sanDocumento = :sanDocumento"),
//@NamedQuery(name = "Sancion.findBySanEstado", query = "SELECT s FROM Sancion s WHERE s.sanEstado = :sanEstado")})
public class Sancion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "san_codigo")
    private Long sanCodigo;
    @Basic(optional = false)
    @Column(name = "san_nombre")
    private String sanNombre;
    @Column(name = "san_descripcion")
    private String sanDescripcion;
    @Column(name = "san_penalidad")
    private String sanPenalidad;
    @Column(name = "san_estado")
    private Short sanEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sanCodigo", fetch = FetchType.LAZY)
    private List<DetalleSancion> detalleSancionCollection;

    public Sancion() {
    }

    public Sancion(Long sanCodigo) {
        this.sanCodigo = sanCodigo;
    }

    public Sancion(Long sanCodigo, String sanNombre) {
        this.sanCodigo = sanCodigo;
        this.sanNombre = sanNombre;
    }

    public Long getSanCodigo() {
        return sanCodigo;
    }

    public void setSanCodigo(Long sanCodigo) {
        this.sanCodigo = sanCodigo;
    }

    public String getSanNombre() {
        return sanNombre;
    }

    public void setSanNombre(String sanNombre) {
        this.sanNombre = sanNombre;
    }

    public String getSanDescripcion() {
        return sanDescripcion;
    }

    public void setSanDescripcion(String sanDescripcion) {
        this.sanDescripcion = sanDescripcion;
    }

    public String getSanPenalidad() {
        return sanPenalidad;
    }

    public void setSanPenalidad(String sanPenalidad) {
        this.sanPenalidad = sanPenalidad;
    }

    public Short getSanEstado() {
        return sanEstado;
    }

    public void setSanEstado(Short sanEstado) {
        this.sanEstado = sanEstado;
    }

    public List<DetalleSancion> getDetalleSancionCollection() {
        return detalleSancionCollection;
    }

    public void setDetalleSancionCollection(List<DetalleSancion> detalleSancionCollection) {
        this.detalleSancionCollection = detalleSancionCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sanCodigo != null ? sanCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sancion)) {
            return false;
        }
        Sancion other = (Sancion) object;
        if ((this.sanCodigo == null && other.sanCodigo != null) || (this.sanCodigo != null && !this.sanCodigo.equals(other.sanCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.colegiatura.be.Sancion[sanCodigo=" + sanCodigo + "]";
    }

}
